Clean up relationship code.