Separated some useful client functions into library/src/client