More refactoring + console output removed.