Refactored fizz buzz function to use helper function.

Change-Id: Idbaae82b89407d2699fa24b8bf1c736166c64f00