optimize IF condition for pacemaker