updating the command tree to remove subcommands and sub-subcommands