Improves aliasing

`replaceall` should be further improved to only loop over doing
replacement once.