Ported changes to use attribute based counter definitions