refactor my oauth routine into robin's module