whole refactoring