added experimental support for extends and discrminator, need to write tests