Refactor code of the rest client
Refactor string utils