Doing some optimizations