refactor debugging output