Moved login-related methods to separate class