reordered macro definitions; removed dead code