Refactored menu groups into a directive