Refactoring ServerThread