refactored create method