Separate node creation code from file reading code.