Reduced the memory consumption