rewrite to allow configuration of relations to compute