Refactor spec