optimizations  to reduce memory footprint