refactored spec