Improvements to minimizing memory usage
Further reduced memory usage for models only.