Back from a coding break. Abstracted and cleaned up item handling code.