Splits data sets for two parts: cached and non-cached.
Many adjustments of code for optimizing the memory usage and performance.