DRYed up website_agent code a bit