cleaner routines, building for bfgs