[ncli_utils/utils.py] refactor