fix genericity and class visibility