refactor Github authentication