More refactoring of browser_action.js