Factored out gaussian window and smoothing