Some kind of inheritance like c++