Move BG render to its own function