introduce hierarchical class-extraction method.