refactor complex timeslot-boolean into function.