clean up code, add base mesh class