Added insertMenu helper function