Refactor to make the file finder a bit simpler and more readable