refactored gif count