some optimizations