Expand macro to solve 'this' capture problem