Refactored to spec