Refactor application menu creation.