move Factory and WrapperTyped to their own files