Refactor to make ElementsAdapter reactive.