Moved handling of sent heartbeats into its own function in PC
Moved heartbeat handling in PC to its own function