better readability
better error handling for resource server access