Refactor client and player