remove unused code, reogorg macro logic