reduce memory usage whenever it is possible