CPT_Factory to standalone file