add more tests for refactored code