A lot of this logic should be moved into the `AdvancedPageViewModel` class. The pattern being used in the application is known as [Model-View-ViewModel](http://en.wikipedia.org/wiki/Model_View_ViewModel) (or MVVM).