Some refactoring
Added a unit test for MenuEntryRules
Refactoring