Code refactoring

Made creating menus and actions cleaner