Minor refactor of exec command