use type constraint instead of implicit arg