Refactor the view and add looping UI