Code cleanup for Oauth2 and Pagination