refactor
unit tests