Revert "changes to improve memory changes"

This reverts commit 1de87c79fc79fda03b47317f0d0139f93e50b3ad.
New change to make less memory usage