Refactor RemoteService to simplify the large method