Split into a separate file and catching the user agent