clean code using type macro when it's possible