reduced dom modifications to minimal number of elements to reduce reflows