refactored certificate methods