refactor github access code some more