refactorin on resource url building