Further heartbeat refactoring (computing package size)

We did something similar. It could and should be merged together at once.