refactoring: remove hard code & define macros