Refactored code so that parties are related to user