reduce code duplication by creating getmeshsizes() method