tidied up the content update code