refactored chrome extension