[code] smarter background control