Refactored entities to enable many-to-many relationships