combine parse functions into a single parseFile function