okcount refactor