Separated matrix reading section from main model.