Tidy-up of some URL construction