Refactor Deflicker code inside iop