refactoring and reorganizing