add Class extend logic