Security provider refactoring.