support more variables, speed up updates as well