cleaner isolation of http-specific code