use macros, fix some inconsitencies