factor out into new method to keep main render() call clean