improve accuracy of file segment timing, clean up unused code.