Bound event listeners to elements rather than document to improve performance