Move common code to get dataset from attached data into Worker