Refactor commands