Refactoring

also mesh preparations