refactor top menu managing