mod_rayo: move some common code, cleanup