Small content script refactoring