Refactor find_resource