final refactoring.