refactor multi browser support