move auth() outside class