More refactoring, simplifying and enhancing.