Update mesh factory

Update mesh factory to use shared buffer