refactor to be reusable by a client.
remvoved generic interface - no meaning for resteasy client.