Add #define and remove useless code