Add edit in the enum and Refactor codes in the switch statement