refactor, add unit test