refactor the heartbeat graph