change fd-vars from a macro to a fn