Major Refactoring.