refactoring!