Factorize all functions, also add PTV and SOCBA to compare