Refactoring; New tests; Increased test coverage