Trying to clean up the contact map implementation