move event handlers into crelevant components