Huang li command factory

optimised command factory