Move methods for IO into separate utility class.