refactor debug logging