Refactor the code to make more sense now it is breaking out of the factor loop