Some cleanup of oauth flow