add support multilevel extends (parent, grandparent, greatgrandparent etc)