Oauth implementation, some more improvements