core func and cli tool - unfinished