move format_cert to utilities