refactor commandexecutor