Function persistence: Replace class instantiation by reflection