def _simple_insert(parameters, insert, remove):
    """
    Build new parameters from old with insertion locations specified.

    *parameters* is the existing parameter list.

    *insert* is list of parameters to insert.

    *remove* is list of parameter names to remove.

    The new parameters are inserted as a block replacing the first removed
    parameter.
    """
    remove = set(remove)
    new_list = []
    for par in parameters:
        if par.id not in remove:
            new_list.append(par)
        if par.id in remove and insert:
            new_list.extend(insert)
            insert = []
    return new_list
