refactor for code coverage