Generalization of all

attempt to decrease the cohesion between the commands and to generalize
their creation

the patch is not for the introduction of the main code, I want to
understand how it's done