refactoring of reminder time computation