Improve class hierarchy