SecurityContextRepository refactoring