improvement in class hierarchy