Minor refactoring to get http prefixes

very minor refactoring to move the putting together of http prefixes
into a single function.