Added factories for working out the base url