split handleMesosStatusUpdate into functions