added FetchOne.
minor refactoring. Added fetchOneThenReplace support.