Most modules are compiling now
Some refactoring