reworked retrieval of data