Refactaring spec