Refactoring, removing dead code.