Refactor existing test and add a new test