Got URL generation working by re-implementing helper code