remove some debugging noise
Simplify some file reading functions