refactor menu animation