Refactored to foreign key mapping.