make ecg_file_util and clean up  code structure