Refactored core/event presence handling

Might need some more tweaking, wouldn't consider this beautiful code

Related #207