add class inheritance and handle class