started to refactor auth logic to own modules