Some common code.