Move count_handlers.py stuff into utils.py