Refactor of record fetch.