Refactored how subcommands are executed