moved data loading code into a single file (common.r)