Some code improvemetns to DerviedDataToHFiles