extend end_date if needed + enhance code lisibility