refactor; save some space; fix edit menu update