Refactored for command-response structure; not working yet ;)