improve certificate and templates