refactored promises in cli command functions