Refactor to browser namespace