model splitting and saving to files