Packages refactoring
Improved conditions for updating certificate