moved some methods to ViewModel