refactor spec