Refactoring events; fixing code according to PSR-2