refactor fibonacci