Added heartbeat revisions and cleaned up some code.