The above 3 lines are repeated multiple times in this file. I think this calls for a utility function that fetches the "entityCache" store asynchronously, or, if we uwrap _database as I described above, synchronously.