Refine github API query/Consolidate Functions