finish refactoring test