rebuild dom to use an array-like object