construction of timestamp from the day of week moved to a separate function