Cleaner counter code