namespacing all event handlers, adding destroy function