You create a string (`pathString`) just to split it in an array. Why don't you create the `urlPaths` array directly ?