Made login a class method