move relationship code out of record mapper
more helpful exceptions