refactor browser handler