Stop maintaining this script in two places