Complete refactoring.