(1) refactoring.
(2) single instantiation of the REngine class.