some code refactor (separate definitions for done and failed requests, some public methods exported for another module)