bind to MainViewModel and code cleanup