restoring lost refactoring
revert the debug code