Improved http message handling