Refine dynamic background logic