Refactoring of security resources