migration to spring security (refactoring)