Refactor of cmd out to helpers to reduce boilerplate - to discuss