WIP: remove macros and rename functions