DRYed and fixed up client hooks