Refactor menu animation