performance optimization in generated factories resulting in much less array_key_exists calls