refactoring!!!