Refactored to MVVM