Move event handlers into constructor