background rendering logic