Compiles again
Minor refactorings