(a-3)b^2-a+3 = (a-3)b^2-(a-3) = (a-3)(b^2-1) = (a-3)(b+1)(b-1)