Replace a unnecessary function call with baseUrl variable