structure the event code that drives page interactions