Add response verification. Code refactoring