separate render code