Encapsulate into a ViewModel class