refactor - move function process_command to subscriber thread