Use MVVM to clean up the code