countdown refactoring