Refactor of auth files