build lab data loading code