algos.factorize should do this
too much if thens otherwise