Moved most logic and event handling to View Model