Refactored and added heartbeat service checking