Rationalise the macro handling a bit