extracted scoped rest client into it's own module