refactoring unused code