refactor inclusion of Test command in CLI