refactor repeated md5 in post and put