Refactor animation selection