refactored authentication, updated docs