fixed some messy code in CommandExecutor class