Why is an ArrayList send down the socket and not a Set as retrieved from myMap.keySet()? If Game is refactored to use a commandfactory similar to what's done in Client, where should the CommandFactory class be (package?) getCommand returns a Command that's pretty client specific, how can it return something useful to the appropriate requester, e.g., GameCommand or ClientCommand hint: Change the Command interface to take an Object parameter create two subclasses using template-pattern/hook method with something like this in the Command class. void execute(Object o) { hook((CastMePlease) o); }