Turning the login viewmodel into a constructor function