Remove copied code
Move to oauth2 library