Split out into MVVM style