Proof of concept with simple implementation
Replace rudimentary event listeners with a state machine