wrapped function snippet