Refactor functions to search from rev table and return files that match