extracted generic get command