Auth refactor

minor refactor for auth part