Here are the time saving changes I made

Portion 1 - function getItem

Analysis