mesh refactoring