Refactored the CommandEdit class