Refactor Spring security with UserDetailsService