fix code style, remove dead code