abstract object counter and refactor frequent item classes