refactor commands