revise Factor and GCD