Remove duplication code
Uri generation extracted