refactor browser side