change API of registering user-defined command factory.