Issue 242 2

These patches clean up the implementation to wait a command response.
Some complicated code was deleted.