final touches on functionality of authentication