code cleanup / alert counting