Remove COND_DEBUG now that it works
Move common code into macros