pacemaker code refactoring