Refactored end date code to use a method in the model instead of a thread in the entity manager