extracted aggregation and dependency logic up to Relation