add tests from refactor