Replace one ugly hack with another one slightly less so