Reduce duplication of file decoding.