Update scanner-v2, Fix some bug, and code refactoring