Huge refactorings...