clean original code to keep only what is usefull