Refactored create_spec with method