Refactored to use proper relationships between models.