In progress massive refactoring.