Reimplement user-agent logic