update factor number impl and test
add guard and syntactic sugar sliden on for comprensions