Refactoring. remove dead code.