Reduce some useless procedure in MedianSmoothing