Rework all the command handling