Make classification methods depend on class attributes