Remove dead code, replace anonymous some classes with inner to simplify start method