Factor out a package for rational roots