Separate logic of the authenticate method into 3 methods

This will make easy to overwrite part of the logic, especially finfing a user instnace.
Increase the version