refactoring fft