Refactor background js and simplify the refresh method on the popup screen