porygon: Refactor URL generation