remove unnecessary foreign functions