Simplify logic of disappearing menu