refactor disable enable menu buttons