refactoring, adding unit tests