github api refactoring