clean up client code a bit