Beyond-mean-field theories with zero-range effective interactions. A way to handle the ultraviolet divergence