Cleaning up relationship file code