MOB-116: Move heart setting code out of loop