better logic split for event listeners. Solves #43