Refactoring of the method populating the end date