Reduce logic in CLI