commands refactor