refactor
fix unit tests