add template function
refactoring to showItemList method