Adds some optimizations