Refactoring of Github repository validation function