Turning registration viewModel into a constructor function