Move mgo structure to variable transformation in algorithm.