move http related code to message