Improved implementation of macro.