ENH: Common Factory infrastructure
replaces the separate implementation for the factory, macros could now be moved to the implementation file of the respective class
replaces the separate implementation for the factory, macros could now be moved to the implementation file of the respective class