Clean up the command handler.

Save cycles by reducing the number of comparisons and tags to be parsed.