Refactored ContactManagerImpl and fixed date checking logic.