start using Event.observe

instead of directly executing inline.