Cut code redundancy in promote-demote