- refactored code and improved test coverage