Move debug helper to separate file