A bunch of changes to integrate the Model and UI