Rearraged a little to adapt MVVM better