Added templates hierarchy guessing