change macro to fn