unify rendering code