Made render code more readable