refactored the retrieven into a set of utilities