Improve performance and memory footprint