Switch to forEach() loops for faster execution
Increase smoothing factor of refinedPeriod from 0 to 55