extract github communication code into a library