Rewrite mesh functions.