added splitSubpartOnFly function