Refactoring to be smarter about finding files and reading headers.