merlin: some cleaning of the derivation