Improved the query for Relationship types. It is now dynamic, not coupled to implementations.