Performance improvements. str_replace() is notably faster