tiny auth refactor