[MGFFT-81] refactor all the clears into a single function