Compiles again
Major refactoring