Move event handler to constructor