encapsulate menu logic in angular service