refactoring + 69% of unit test coverage