start changing some macros to inline functions/switch in a seperate
file.