Make function that sets baseURL reusable