Cleaned up relationship saving code a little bit