Split out CommandFactory's type generation into it's own factory type.