tons of refactoring - reordering of event priority - unification of error handling