Remove dependency on semigroups