Small refactor on data retrieval