Added browser support
Refactoring