Confused by service_template

ok here goes, im stuck really, having a blackout i guess.

need this to work depending on the state of my input_select.mode, which has 4 options. I have the services set now on each individual mode via a scene or script, so declare each set 4 times. There must be an easier, better shorter way.
I cant add this sequence to my developer mode switch, cause that has only 2 states…while 4 modes are involved.

  - alias: 'set Dev groups'
    id: 'set Dev groups'
    initial_state: 'on'
    trigger:
      platform: state
      entity_id: input_select.mode
    condition: []
    action:
    service_template: >
      {% if is_state('input_select.mode', 'developer') %}
        - group.set
          data:
            object_id: developer
            view: true
            visible: true
       -  input_boolean.turn_on
          entity_id: input_boolean.notify_developing
      {% else %}
              - group.set
                data:
                 object_id: developer
                view: false
                visible: false
          -    group.remove
                data:
                object_id: catchall
        - input_boolean.turn_off
          entity_id: input_boolean.notify_developing
       {%endif%}

or should i best create intermediary scripts and use these in the template:

script:
  dev_on:
    alias: Dev on
    sequence:
      - service: group.set
        data:
          object_id: developer
          view: true
          visible: true
      - service: input_boolean.turn_on
        entity_id: input_boolean.notify_developing
  dev_off:
    alias: Dev off
    sequence:
      - service: group.remove
        data:
          object_id: catchall
      - service: group.set
        data:
          object_id: developer
          view: false
          visible: false
      - service: input_boolean.turn_off
        entity_id: input_boolean.notify_developing

with automation:

  - alias: 'set Dev groups'
    id: 'set Dev groups'
    initial_state: 'on'
    trigger:
      platform: state
      entity_id: input_select.mode
    condition: []
    action:
    service_template: >
       {% if is_state('input_select.mode', 'developer') %}
         script.dev_on
      {% else %}
        script.dev_off
       {%endif%}

The second one :+1: