feature macros
more refactoring