Moved some match queries onto the relationships. 

Might be room to DRY it up even more.