Refactor for browser