Refactored work attempt code, and implemented pinging client