Make execute function reusable for custom menu items (not complete)