refactored the spec tests