Added smarter logic to contact import