moving event dispatcher into core