Refactored fizzbuzz method