decrease complexity of render_certificate