Minor refactor to break up the switch block. Event -> method mapping is now used instead.