code refactoring: cleanup