refactored fibonacci example