making things more modular by moving file-parsing into its own method