refactor and minor corrections
- command XXXCommand becomes XXX
- commandPrompt modification for proper connection closing and reopening