Commit after variable introduction to hit DOM less number of times