move loading function to a utility file, start converting rigid registration to hessian free