a quick clean up and documentation of authentication class