moves logic to http_helper