Messy codes fixed