Move some implementations to cpp file in Joint class.