Refactor search url resolution, may break something