Reference code generation.