Simplify code to enumerate browser windows