Split alterForCommands into 2 functions

One for formatting, one for commands.