simplify render function