Certificate fix, Refactoring