Code refactoring related to empty data set display