More test coverage, now get 100% + refactoring