Refactor to JRIEngine