implement the data-view logic