Improve the macro to define local variables