Refactor mesh