Change to MVVM pattern