MenuItem query optimized so that only one query is performed.
Added some documentation.