refactored the time slots generation into a module, with related tests.