Refactored content.js w/ encapsulation