move browser detection where needed