refactor item event handling so the handling function is in the item class file