Reduce duplicated code

Make use of request.host()