Updated with event optimisation.