commented out console.log in debug.info, plus some refactoring.