Much clean code refactoring.