added a collection that manages the clients and did some refactoring