Separate code into dataset-specific and generic