Add method to parse file directly.
A few minor stylistic changes.