Modified algorithm to retrieve. Now, the class of the instance is not used