move command definition to a common file
implements read