move minimization back into utils, and clean up imports