Refactor find_dispatch to loop data functions and macros lists just once