renamed to register_primitive