Refactor url building and service config