Many many small refactorings, further refactoring to remove Engine