This approach feels a bit dirty to me. Why does the source have to be passed in here, rather than having `processFile()` read stdin? If that was the case, the function would behave the same in all cases (check `filename`, then read from it).