Improved i/o management when building the model