render function factorization