Improve memory management.