Reduce fprintf statements