Fix Firefox scope bug
Thursday night refactoring