factor out base_url