Halfway through refactoring. Time for lunch though!