extract functionality from CLI into Github class.