refactor test