Move logic from background page
refactoring
Refactor...
progress bar