Refactored the fibonacci generator