optimization: use NULL ptr to determine static menu size