extracted the building of a command pair