Better event listener registration