refactor auth obj creation