refactor test spec