Update with some optimizations