Frequency analysys refactoring