refactoring/code cleanup