remove unless dependencies and fix the relation logic