improve cert decode