initially done with client code