Refactor the contact stuff