refactored debug logs