Clean up graphics code to be more consistent