Refactored formatting of commands.