Calculate base url directly in model.