improve transclude path logic