Matt Gallagher's Singleton macro