speed up model evaluation by reducing system calls
refactor generation of primal solutions