helper for constructing relationships between models