made some optimizations