rendering code cleanup