Modify for inheritance.

I change class from factory class to base class,now it easier for inherit kub.