Moved health update code into method