Refactor GitHub script