Some additional changes

Some styling changes and also adds ability to use any common parent
class of the events as parameter.
Please squash your commits together with this one and make a pull
request with single commit for cleaner history.