improve browser code