Help With Automation House Keeping / Auditing

Morning All,

Right, so just like many of you on here, I have plethora of automations set up in my Home Assistant.
I was wondering if anyone could provide some tips / “house keeping” rules they apply to their automations that keep them more concise. Obviously I can’t post all my automations, however there is one thing I do that I would think could be remedied. For a lot of things I have two automations for on/off states. A simple example is I have two automations for my cupboard, one that tuns on the light when the door is opened and another that turns off the light when the door is closed. Surely these can be amalgamated into one?

- action:
  - data:
      entity_id: switch.cupboard_light
    service: switch.turn_on
  alias: Cupboard Door Open
  condition: []
  id: '1521223576654'
  trigger:
  - entity_id: binary_sensor.door_window_sensor_158d00019d1f76
    from: 'off'
    platform: state
    to: 'on'
- action:
  - data:
      entity_id: switch.cupboard_light
    service: switch.turn_off
  alias: Cupboard Door Closed
  condition: []
  id: '1521223758954'
  trigger:
  - entity_id: binary_sensor.door_window_sensor_158d00019d1f76
    from: 'on'
    platform: state
    to: 'off'

Other than correcting the above do you have any other tips or rules you try and stick to?