Minor refactoring and optimizations in background Tab