refactored create method name to generateCode