refactoring initialization and response processing in favor of readabili...

...ty and performance

improved PR #224