compact code

- move stateChange into a reuseable function
- use `toggleClass` intsead of `addClass` / `removeClass`
- save placeholder for later use