idf tools: code cleanup and debugging