More refactoring and 100% test coverage