Better way to transform paths