Optimize Memory usage