Simplify class hierarchy a bit.