wip cleanup of rendering code