refactoring events a bit
more events registered and implemented, some more refactorings