swap isMaster condition for readability, remove unused event listener