refactor(client): lib & test