Extract split menu and section menu to functions