refactoring sampling rate