Get proper asynchrony handled for authentication, simplify many files