Refactoring to get rpc calls from view models.