Replace debugging by firing events