Use the parent directory of the file to narrow down the search
Minor refactor