refactor viewmodel, replace with broadcast receiver