Refactored spec tests