Adding split file logic