organizing and refactoring