Why are you declaring `urlParts` in this scope? It should only exist within `createBase`, I would say.