cleanup, remove dead code, remove useless optimization