Refactored create contact history funtion