refactored create