cleanup unused macros and code