Cleaned up the command processing if block.