Suggest to use a map to replace the if/else logic.