adding custom events
a lot of code cleanup, the framework is looking nice