refactor to display the data provided by the caller