reworked authentication module