refactoring and organizing