move bindEvents function to an external utils.js file