More refactoring, looking much better