refactor
refactor getItem() function