manipulating events to using functors and OCaml's with type :)