Factorize render functions