combined file format related stuff into a single class