Convert the displaying of output to MVVM