merge from my repo, review some things and add replace, ajax