refactoring continues...