Cleaned up some of the client code.