refactor exec command