Expanded generic factory interface. Relates to #2.