refactor spec test