refactor the refactored and add tests
new tests