generalized item retrieval code