Copy improved compilation system from single_lepton_search