utils for data  storage in memory