cleanup refactoring