we need to consider if it is really necessary to export single functions like addAlarmTimeout or toMidnight as globals. Maybe we need to consider refactoring