some code restructured to make it better readable

and see what is needed for custom app menu

Signed-off-by: ekkes-corner <ekke@ekkes-corner.org>