Fixed an obvious weakness in class hierarchy