refactoring, calc rate.