Rest client
Some other refactoring