improved class hierarchy