moving event handlers outside of initialize method