clean up tests and fix code style issue