generateCode load functions