diff --git a/bin/cdist-cache b/core/__cdist_cache
similarity index 60%
rename from bin/cdist-cache
rename to core/__cdist_cache
index ee27ffb4..44c60125 100755
--- a/bin/cdist-cache
+++ b/core/__cdist_cache
@@ -18,22 +18,17 @@
# along with cdist. If not, see .
#
#
-# Let's build a cconfig tree from a configuration
-# And save it into the cache tree
+# Save the configuration tree into the local cache
#
-. cdist-config
-[ $# -eq 1 ] || __cdist_usage ""
-set -u
+__cdist_cache()
+{
+ # Create base to move into
+ mkdir -p "${__cdist_local_base_cache_dir}"
-__cdist_target_host="$1"; shift
-
-# Create base to move into
-mkdir -p "${__cdist_local_base_cache_dir}"
-
-# Now determine absolute path
-__cdist_ddir="$(__cdist_host_cache_dir "$__cdist_target_host")"
-
-__cdist_echo info "Saving cache to $__cdist_ddir "
-rm -rf "$__cdist_ddir"
-mv "$__cdist_local_base_dir" "$__cdist_ddir"
+ __cdist_echo info \
+ "Saving cache to $(__cdist_host_cache_dir "$__cdist_target_host")"
+ rm -rf "$(__cdist_host_cache_dir "$__cdist_target_host")"
+ mv "$__cdist_local_base_dir" \
+ "$(__cdist_host_cache_dir "$__cdist_target_host")"
+}