Further authentication changes
Cleanup and add more doc blocks