cleanup refactor