simplified some more render code