cleaned up client code