redesign the view changed logic