tree UPDATE remove deprecated/unused symbols
diff --git a/src/schema_compile.c b/src/schema_compile.c
index dc59314..18e7a96 100644
--- a/src/schema_compile.c
+++ b/src/schema_compile.c
@@ -127,7 +127,6 @@
 
         /* compile the extension definition */
         *ext = ep->compiled = calloc(1, sizeof **ext);
-        (*ext)->refcount = 1;
         DUP_STRING_GOTO(ctx->ctx, ep->name, (*ext)->name, ret, cleanup);
         DUP_STRING_GOTO(ctx->ctx, ep->argname, (*ext)->argname, ret, cleanup);
         LY_CHECK_GOTO(ret = lysp_ext_find_definition(ctx->ctx, extp, (const struct lys_module **)&(*ext)->module, NULL),
diff --git a/src/tree_data.c b/src/tree_data.c
index 722c332..df36c58 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -1152,16 +1152,6 @@
     return LY_SUCCESS;
 }
 
-LIBYANG_API_DEF const struct lyd_node_term *
-lyd_target(const struct ly_path *path, const struct lyd_node *tree)
-{
-    struct lyd_node *target = NULL;
-
-    lyd_find_target(path, tree, &target);
-
-    return (struct lyd_node_term *)target;
-}
-
 /**
  * @brief Check the equality of the two schemas from different contexts.
  *
diff --git a/src/tree_data.h b/src/tree_data.h
index 6d89d7f..011431e 100644
--- a/src/tree_data.h
+++ b/src/tree_data.h
@@ -2333,16 +2333,6 @@
 LIBYANG_API_DECL LY_ERR lyd_diff_reverse_all(const struct lyd_node *src_diff, struct lyd_node **diff);
 
 /**
- * @brief Deprecated, use ::lyd_find_target() instead.
- *
- * @param[in] path Compiled path structure.
- * @param[in] tree Data tree to be searched.
- * @return Found target node,
- * @return NULL if not found.
- */
-LIBYANG_API_DECL const struct lyd_node_term *lyd_target(const struct ly_path *path, const struct lyd_node *tree);
-
-/**
  * @brief Types of the different data paths.
  */
 typedef enum {
diff --git a/src/tree_schema.h b/src/tree_schema.h
index 0fdf109..ffb1b2f 100644
--- a/src/tree_schema.h
+++ b/src/tree_schema.h
@@ -1185,7 +1185,6 @@
     struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */
     struct lyplg_ext *plugin;        /**< Plugin implementing the specific extension */
     struct lys_module *module;       /**< module structure */
-    uint32_t refcount;               /**< unused, always 1 */
     uint16_t flags;                  /**< LYS_STATUS_* value (@ref snodeflags) */
 };
 
@@ -1349,7 +1348,6 @@
     uint32_t refcount;               /**< reference counter for type sharing */
     struct lyxp_expr *path;          /**< parsed target path, compiled path cannot be stored because of type sharing */
     struct lysc_prefix *prefixes;    /**< resolved prefixes used in the path */
-    const struct lys_module *cur_mod;/**< unused, not needed */
     struct lysc_type *realtype;      /**< pointer to the real (first non-leafref in possible leafrefs chain) type. */
     uint8_t require_instance;        /**< require-instance flag */
 };
diff --git a/tests/utests/data/test_tree_data.c b/tests/utests/data/test_tree_data.c
index bf21486..5dd3473 100644
--- a/tests/utests/data/test_tree_data.c
+++ b/tests/utests/data/test_tree_data.c
@@ -401,7 +401,7 @@
             LY_PATH_PREFIX_OPTIONAL, LY_PATH_PRED_SIMPLE, &exp));
     assert_int_equal(LY_SUCCESS, ly_path_compile(UTEST_LYCTX, NULL, NULL, NULL, exp, LY_PATH_OPER_INPUT,
             LY_PATH_TARGET_SINGLE, 1, LY_VALUE_JSON, NULL, &path));
-    term = lyd_target(path, tree);
+    assert_int_equal(LY_SUCCESS, lyd_find_target(path, tree, (struct lyd_node **)&term));
 
     const int unsigned flag = LYS_CONFIG_R | LYS_SET_ENUM | LYS_ORDBY_USER;