refacto event manager