Factored some repetition out of graphics rendering