Improve memory consumption