What are the similarities between contract and law?