Authentication backends refactoring