Generalize code by getAmountOfOverlappingDays
final cleanup