More refactoring of security.