added command args; refactoring

Signed-off-by: Richard Adams <rich.adams@no.reply>