refactorings in authentication :)
Merge pull request #55 from dpolivaev/master

refactoring :)