fix and refactor removing listeners;