Improving memory usage and missing values handling