Refactor commands with Modal window