initCode and finalCode now loaded from XML