Refactor _add_subcommands().