HeartBeater code refactoring