Made small improvements to the factorOp method so it is more efficient
Made small improvement in the instVar method