further cleaning up of draw code