refactoring of ItemRenderer and CategoryRenderer