Refactor test